class BatchProcessor : public QObject {
    Q_OBJECT
public:
    struct BatchTask {
        QString meshFile;
        QString outputFile;
        AdvancedOptimizer::OptimizationParams params;
    };

    // 添加任务
    void addTask(const BatchTask& task) {
        m_tasks.push_back(task);
    }

    // 执行批处理
    void processBatch() {
        for(const auto& task : m_tasks) {
            // 加载网格
            MeshData mesh;
            if(!loadMesh(task.meshFile, mesh)) {
                emit taskFailed(task.meshFile, "Failed to load mesh");
                continue;
            }

            // 优化
            AdvancedOptimizer optimizer;
            if(!optimizer.optimize(mesh, task.params)) {
                emit taskFailed(task.meshFile, "Optimization failed");
                continue;
            }

            // 保存结果
            if(!saveMesh(task.outputFile, mesh)) {
                emit taskFailed(task.meshFile, "Failed to save result");
                continue;
            }

            emit taskCompleted(task.meshFile);
        }
        
        emit batchCompleted();
    }

signals:
    void taskCompleted(const QString& meshFile);
    void taskFailed(const QString& meshFile, const QString& error);
    void batchCompleted();

private:
    std::vector<BatchTask> m_tasks;
}; 